package com.smart.gui;

import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;

import com.jgoodies.forms.factories.FormFactory;
import com.jgoodies.forms.layout.ColumnSpec;
import com.jgoodies.forms.layout.FormLayout;
import com.jgoodies.forms.layout.RowSpec;

public class TOC_Form_Define_Candidate_Test_Cases extends JFrame {

	/**
	 * 
	 */
	private static final long serialVersionUID = -4698748944522407756L;

	private JPanel contentPane;

	/**
	 * singleton pattern -- getInstance
	 */
	private static TOC_Form_Define_Candidate_Test_Cases uniqueInstanceForm;

	public static synchronized TOC_Form_Define_Candidate_Test_Cases getInstance() {
		if (uniqueInstanceForm == null) {
			try {
				uniqueInstanceForm = new TOC_Form_Define_Candidate_Test_Cases();
			} catch (Exception e) {
				e.printStackTrace();
			}
		}
		return uniqueInstanceForm;
	}

	/**
	 * Create the frame.
	 */
	public TOC_Form_Define_Candidate_Test_Cases() {
		ButtonHandler handler = new ButtonHandler(this);

		setTitle("Table of Contents of Define Candidate Test Cases Questionnaires");
		setDefaultCloseOperation(JFrame.HIDE_ON_CLOSE);
		setBounds(100, 100, 540, 165);
		contentPane = new JPanel();
		contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
		setContentPane(contentPane);
		contentPane
				.setLayout(new FormLayout(new ColumnSpec[] {
						FormFactory.RELATED_GAP_COLSPEC,
						FormFactory.DEFAULT_COLSPEC,
						FormFactory.RELATED_GAP_COLSPEC,
						FormFactory.DEFAULT_COLSPEC,
						FormFactory.RELATED_GAP_COLSPEC,
						FormFactory.DEFAULT_COLSPEC,
						FormFactory.RELATED_GAP_COLSPEC,
						ColumnSpec.decode("default:grow"), }, new RowSpec[] {
						FormFactory.RELATED_GAP_ROWSPEC,
						FormFactory.DEFAULT_ROWSPEC,
						FormFactory.RELATED_GAP_ROWSPEC,
						FormFactory.DEFAULT_ROWSPEC,
						FormFactory.RELATED_GAP_ROWSPEC,
						FormFactory.DEFAULT_ROWSPEC,
						FormFactory.RELATED_GAP_ROWSPEC,
						FormFactory.DEFAULT_ROWSPEC,
						FormFactory.RELATED_GAP_ROWSPEC,
						FormFactory.DEFAULT_ROWSPEC,
						FormFactory.RELATED_GAP_ROWSPEC,
						FormFactory.DEFAULT_ROWSPEC,
						FormFactory.RELATED_GAP_ROWSPEC,
						FormFactory.DEFAULT_ROWSPEC,
						FormFactory.RELATED_GAP_ROWSPEC,
						FormFactory.DEFAULT_ROWSPEC,
						FormFactory.RELATED_GAP_ROWSPEC,
						FormFactory.DEFAULT_ROWSPEC, }));

		JLabel label = new JLabel("1)");
		contentPane.add(label, "2, 4");

		JButton btnCOTC = new JButton("Characteristics of Test Cases");
		btnCOTC.setActionCommand(ButtonHandler.COTC);
		btnCOTC.addActionListener(handler);
		contentPane.add(btnCOTC, "4, 4");

		JLabel label_1 = new JLabel("2)");
		contentPane.add(label_1, "2, 6");

		JButton btnTCC = new JButton("Test Case Creation");
		btnTCC.setActionCommand(ButtonHandler.TCC);
		btnTCC.addActionListener(handler);
		contentPane.add(btnTCC, "4, 6");

		JLabel label_2 = new JLabel("3)");
		contentPane.add(label_2, "2, 8");

		JButton btnTCA = new JButton("Test Code Analysis");
		btnTCA.setActionCommand(ButtonHandler.TCA);
		btnTCA.addActionListener(handler);
		contentPane.add(btnTCA, "4, 8");
	}

}
